home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / MW MPW Binaries 1.1.1a2 / mwcPPC / MWCIncludes / Disassembler.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-18  |  25.3 KB  |  452 lines  |  [TEXT/MMCC]

  1. /*---------------------------------------------------------------------------*
  2.  |                                                                           |
  3.  |                          <<< Disassembler.h >>>                           |
  4.  |                                                                           |
  5.  |                     Power[PC] Disassembler Interfaces                     |
  6.  |                                                                           |
  7.  |                               Ira L. Ruben                                |
  8.  |                                  5/9/93                                   |
  9.  |                                                                           |
  10.  |                     Copyright Apple Computer, Inc. 1993                   |
  11.  |                           All rights reserved.                            |
  12.  |                                                                           |
  13.  *---------------------------------------------------------------------------*/
  14.  
  15. #ifndef __DISASSEMBLER__
  16. #define __DISASSEMBLER__
  17.  
  18. #if 0
  19. #define DisHdrVersion "1.0"                /* Current version nbr.rev of this header        */
  20. #endif
  21.  
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25.  
  26. #ifndef __TYPES__                                                    /* private (normally predefined) types...            */
  27. typedef unsigned char Boolean;
  28. enum {false, true};
  29. #endif
  30.  
  31.  
  32. /* All assembler options are of type DisassemblerOptions:                                                                */
  33.  
  34. typedef unsigned long DisassemblerOptions;
  35.  
  36. /* The following defines the "options" that can be passed to the disassembler.  All            */
  37. /* except ONE of the target architecture options have preset defaults.                                    */
  38.  
  39.                                                                                         /* Target architecture (one must be set):        */
  40. #define Disassemble_Power             0x00000001UL    /*    Power                                                                    */
  41. #define Disassemble_PowerPC32     0x00000002UL    /*       32-bitPowerPC                                            */
  42. #define Disassemble_PowerPC64  0x00000004UL    /*          64-bit PowerPC                                     */
  43. #define Disassemble_PowerPC601 0x00000008UL    /*             PowerPC 601                                    */
  44.                                                                                         /* Error detection options:                         */
  45. #define Disassemble_RsvBitsErr 0x80000000UL    /*    invalid reserved bits is error                */
  46. #define Disassemble_FieldErr     0x40000000UL    /*    invalid field (regs, BO, etc.) error    */
  47.                                                                                         /* Formatting options (reverses presets):        */
  48. #define Disassemble_Extended     0x08000000UL    /*    extended mnemonics (ppc only)                    */
  49. #define Disassemble_BasicComm     0x04000000UL    /*    basic form in comment if extended            */
  50. #define Disassemble_DecSI             0x02000000UL    /*    SI fields formatted as decimal                */
  51. #define Disassemble_DecUI             0x01000000UL    /*    UI fields formatted as decimal                */
  52. #define Disassemble_DecField     0x00800000UL    /*         fields shown as decimal                                */
  53. #define Disassemble_DecOffset     0x00400000UL    /*    D of D(RA) shown in decimal                        */
  54. #define Disassemble_DecPCRel     0x00200000UL    /*    $+decimal offset instead of $+hex            */
  55. #define Disassemble_DollarHex     0x00100000UL    /*    $XXX... instead of 0xXXX...                        */
  56. #define Disassemble_Hex2sComp     0x00080000UL    /*         negative hex shown in 2s compliment        */
  57. #define Disassemble_MinHex         0x00040000UL    /*        min nbr of hex digits for values >= 0    */
  58. #define Disassemble_CRBits         0x00020000UL    /*    crN_LT, crN_GT, crN_EQ, crN_SO                */
  59. #define Disassemble_CRFltBits  0x00010000UL    /*        crN_FX, crN_FEX, crN_VX, crN_OX                */
  60. #define Disassemble_BranchBO     0x00008000UL    /*        branch BO meaning if not extended            */
  61. #define Disassemble_TrapTO          0x00004000UL    /*        trap TO meaning if not extended                */
  62. #define Disassemble_IBM                 0x00002000UL    /*    IBM assembler conventions                            */
  63.                                                                                                                                                                                 /*
  64. Except for the target architecture options, ONE of which must be set, here's an explanation
  65. of the other options and their preset default.
  66.      
  67. Disassemble_RsvBitsErr - Reserved bits in PowerPC instructions are considered a "warning"
  68.                                                  and causes the return status to be set to indicate whether
  69.                                                  reserved bits were incorrectly coded (1's that should be 0's and
  70.                                                  vice versa). The option indicates incorrectly coded reserved bits
  71.                                                  cause the instruction to be treated as "invalid".
  72.  
  73. Disassemble_FieldErr     - Attempted use of a field value not valid for a target is
  74.                                                  considered a "warning" and causes the return status to be set to
  75.                                                  indicate that fact.  The option indicates that use of a field
  76.                                                  whose value is not valid for the target is "invalid".  An example
  77.                                                  of an invalid field would be the use of a SPR not supported for
  78.                                                  the target architecture like the "HIDx" SPRs which are only valid
  79.                                                  for the 601.  Another example is non zero bits in the bc[l][a] BO
  80.                                                  field that are supposed to be zero.  Note this is NOT the same as
  81.                                                  Disassemble_RsvBitsErr.  But if a field has NO valid decoding
  82.                                                  value for ANY target, that is always considered as an invalid
  83.                                                  instruction.
  84.  
  85. Disassemble_Extended     - Extended mnemonics are NOT generated.  The option allows the
  86.                                                  extended mnemonic generation (recommended).  Only PowerPC32,
  87.                                                  PowerPC64, and PowerPC32 and PowerPC64 instructions used on the
  88.                                                  601 are supported.
  89.  
  90. Disassemble_BasicComm     - The basic instruction form is NOT placed in the comment field.
  91.                                                  The option causes the basic form of the instruction to be placed
  92.                                                  in the comment if an extended mnemonic is generated for it.  This
  93.                                                  option is not recommended since it is mainly for debugging and it
  94.                                                  tends to "clutter" up the comment field making it harder to see
  95.                                                  branch addresses.
  96.  
  97. Disassemble_DecSI             - SIs (signed immediate integers) are formatted as hex.  The option
  98.                                                  causes SI operands to be generated as decimal integers.
  99.  
  100. Disassemble_DecUI             - UIs (unsigned immediate integers) are formatted as hex.  The
  101.                                                  option causes UI operands to be generated as decimal integers.
  102.  
  103. Disassemble_DecField     - All fields (e.g., shift/rotate constants) are shown as hex.  The
  104.                                                  option causes the offsets to be generated as decimal integers.
  105.  
  106. Disassemble_DecOffset  - The "D" offsets in operands of the form D(RA) are shown in hex.
  107.                                                  The option causes these to be generated as decimal.
  108.  
  109. Disassemble_DecPCRel     - PC-relative branch addresses are formatted as "$+n" or "$-n", with
  110.                                                  the offset ("n") generated in hex.  The option causes the offset
  111.                                                  to be generated as decimal.
  112.  
  113. Disassemble_DollarHex     - Hex values are prefixed with "0x".  The option causes hex values
  114.                                                  to be formatted as "$XXX...".
  115.  
  116. Disassemble_Hex2sComp     - Signed negative values that are shown in hex are negated and
  117.                                                  prefixed with a "-" (e.g. "-0x0001").  The option causes these
  118.                                                  values to be shown in their two's complement form (e.g.,
  119.                                                  "0xFFFFFFFF").
  120.  
  121. Disassemble_MinHex         - Positive hex values or negated negative values are always shown
  122.                                                  with the number of digits attempting to indicate the size of the
  123.                                                  instruction field which produced the value or the implied value
  124.                                                  size.  Thus 32-bit target addresses are shown as 8 hex digits,
  125.                                                  16-bit field values are shown with 4 hex digits, byte field values
  126.                                                  as 2 hex digits.  5 or six-bit values are also shown as 2 hex
  127.                                                  digits since the minimum is always at least 2. The option forces
  128.                                                  the generation to always use 2 as the minimum even if the value
  129.                                                  came from a bigger field (e.g., "0x1234" address, "0x01" or
  130.                                                  "-0x01" from a 16-bit field).
  131.  
  132. Disassemble_CRBits          - Condition register field bits are referenced as bit numbers 0:31
  133.                                                  in the basic instruction operand forms.  The option causes these
  134.                                                  bits to be referenced using the format “crN_X”, where N is a 4-bit
  135.                                                  CR field (0:7) and X is the bit “name” in the field (“LT”, “GT”,
  136.                                                  “EQ”, “SO” for bits 0, 1, 2, and 3 respectively).  Note, this
  137.                                                  notation is always used with extended mnemonics.
  138.  
  139. Disassemble_CRFltBits  - Condition register field bits are referenced as bit numbers 0:31
  140.                                                  in the basic instruction operand forms.  The option is identical
  141.                                                  to Disassemble_CRBits to generate the references as “crN_X”,
  142.                                                  except that the bits (X) are referenced as “FX”, “FEX”, “VX” and
  143.                                                  “OX” for the four bits 0,1, 2, and 3 respectively.  This option
  144.                                                  can be used if the context of floating-point operations, but it's
  145.                                                  up to the caller to determine that context.
  146.  
  147. Disassemble_BranchBO     - Branch test BO encodings are referenced as values 0:31 in the 
  148.                                                  basic instruction operand forms.  The option causes the BO value
  149.                                                  to be referenced as more meaningful names (e.g., "dCTR_NZERO_NOT",
  150.                                                  "ALWAYS", etc.).
  151.                                                  
  152. Disassemble_TrapTO         - Trap TO operand encodings are referenced as values 0:31 in the 
  153.                                                   basic instruction operand forms.  The option causes the TO value
  154.                                                  to be an expression of the form "x|y|...", where the "x", "y",
  155.                                                  and so are the meaning of each of the five TO bits; "LT", "GT",
  156.                                                  "EQ", "LOW", "HI" for bits 0, 1, 2, 3, and 4 respectively.
  157.  
  158. Disassemble_IBM                 - Apple assembler conventions are used for comments and invalid
  159.                                                  instructions.  The option causes IBM assembler conventions to be
  160.                                                  used for these.  A “#” is used instead of a “;” as the comment
  161.                                                  character, and “.long” is used instead of “dc.l” for the invalid
  162.                                                  instruction directive mnemonic.
  163.  
  164.                                   [Are we having fun yet?]                                                                */
  165.  
  166. /* The following defines a set of the above options which seem to give "acceptable"         */
  167. /* results:                                                                                                                                                            */
  168.  
  169. #define DisStdOptions (Disassemble_Extended  |            /* permit extended mnemonics                */\
  170.                        Disassemble_DecSI     |            /* decimal SIs but hex UIs                    */\
  171.                        Disassemble_DecField  |            /* decimal field numbers                        */\
  172.                        Disassemble_BranchBO  |            /* meaning of branch BO                            */\
  173.                                              Disassemble_TrapTO         |            /* meaning of trap TO                                */\
  174.                                              Disassemble_CRBits)                    /* CR bits references as crN_X            */
  175.                                              
  176.  
  177. /* The optional lookup function (NULL could be passed) is used to allow the caller to        */
  178. /* substitute name strings for various objects that can occur in an operand.  It should    */
  179. /* return a pointer to a non-null string if substitution is desired.  If NULL or a null */
  180. /* string is returned, the disassembler uses its own default names.  The following            */
  181. /* defines the possible substitable objects:                                                                                        */
  182.  
  183. typedef enum {                                                            /* Types of substitutable objects:                    */
  184.     Disassembler_Lookup_GPRegister,                        /*            general purpose register                        */
  185.     Disassembler_Lookup_FPRegister,                        /*            floating point register                            */
  186.     Disassembler_Lookup_UImmediate,                        /*            unsigned immediate value                        */
  187.     Disassembler_Lookup_SImmediate,                        /*            signed (32-bit) immediate value            */
  188.     Disassembler_Lookup_AbsAddress,                        /*            absolute addresse                                        */
  189.     Disassembler_Lookup_RelAddress,                        /*            relocatable addresse                                */
  190.     Disassembler_Lookup_RegOffset,                        /*            offset from a base register                    */
  191.     Disassembler_Lookup_SPRegister                        /*            special purpose register                        */
  192. } DisassemblerLookupType;
  193.  
  194. /* Here's a definition of an object (value) which is a function of each                                 */
  195. /* DisassemblerLookupType:                                                                                                                            */
  196.  
  197. union DisLookupValue {                                            /* A "meaningful" name for each value type:    */
  198.     unsigned long gpr;                                                /*        Disassembler_Lookup_GPRegister                */
  199.     unsigned long fpr;                                                /*        Disassembler_Lookup_FPRegister                */
  200.     unsigned long ui;                                                    /*        Disassembler_Lookup_UImmediate                */
  201.     long                    si;                                                    /*        Disassembler_Lookup_SImmediate                */
  202.     long                    absAddress;                                    /*        Disassembler_Lookup_AbsAddress                */
  203.     long                    relAddress;                                    /*        Disassembler_Lookup_RelAddress                */
  204.     unsigned long    spr;                                                /*         Disassembler_Lookup_SPRegister                */
  205.     struct {                                                                    /*        Disassembler_Lookup_RegOffset                    */
  206.         short                  offset;
  207.         unsigned short baseReg;
  208.     } regOffset;
  209. };
  210. typedef union DisLookupValue DisLookupValue, *DisLookupValuePtr;
  211.  
  212. /* The "lookup" substitution routine for the above objects is defined as follows:                */
  213.  
  214. typedef char *(*DisassemblerLookups)(void                                                 *refCon,
  215.                                                                          const unsigned long                      *cia, 
  216.                                                                          const DisassemblerLookupType lookupType,
  217.                                                                          const DisLookupValue                  thingToReplace);
  218.  
  219. /* where, refCon                  = A "reference constant" that can be used as a communication link
  220.                                                      between the lookup routine and the caller of the disassembler.
  221.                                                      It is the same refCon passed to the disassembler.
  222.  
  223.                     cia                       = The instruction address passed to the disassembler.
  224.  
  225.                     lookupType and
  226.                     thingToReplace = The kind of object and the associated value of that object to be
  227.                                                      replaced.  As defined by DisLookupValue, the thingToReplace has
  228.                                                      the following value for each lookupType.
  229.  
  230.                                                      lookupType                                                value            
  231.                                                      ============================================= 
  232.                                                      Disassembler_Lookup_GPRegister        0:31                
  233.                                                      Disassembler_Lookup_FPRegister        0:31                
  234.                                                      Disassembler_Lookup_UImmediate        integer    
  235.                                                      Disassembler_Lookup_SImmediate        integer        
  236.                                    Disassembler_Lookup_AbsAddress        address [1]
  237.                                                      Disassembler_Lookup_RelAddress        address [2]
  238.                                                      Disassembler_Lookup_RegOffset        D + Ra  [3]
  239.                                                      Disassembler_Lookup_SPRegister        spr            [4]
  240.                                                      =============================================
  241.  
  242.                                                       Notes: 
  243.                                                      
  244.                                                      [1] This is an absolute target branch address, i.e., the "a" bit
  245.                                                               in the branch instruction IS set.  The passed absAddress
  246.                                                              is the address contained in the instruction.
  247.                                                              
  248.                                                      [2] This is a relocatable target branch address, i.e., the "a"
  249.                                                               bit in the branch instruction was NOT set.  The relAddress
  250.                                                              is relative to the current instruction address adjusted
  251.                                                              by the dstAdjust.  Thus,
  252.                                                              
  253.                                                              relAddress = destinationAddress + dstAdjust + cia
  254.                                                              
  255.                                                              where cia is the current instruction address, i.e, the value
  256.                                                              of the instruction address passed to the disassembler.
  257.                                                                             
  258.                                                      [3] Both the offset (D) and base register (Ra) are passed.  The
  259.                                                               DisLookupValue.regOffset value defines how they are packed
  260.                                                              in the thingToReplace.  The offset should be assigned to a
  261.                                                              long to get its true 32-bit value.  It is valid to pass it
  262.                                                              as a signed short since the instruction field from which it
  263.                                                              came is never more than 16 bits wide.
  264.                                                      
  265.                                                      [4] The lookup for SPRs is slightly different in that it is only
  266.                                                               done as an ESCAPE mechanism, i.e., only when the SPR number is
  267.                                                              NOT one of the predefined Power, 601, PowerPC32, or
  268.                                                              PowerPC64 SPR names.  This is done because a different
  269.                                                              PowerPC architectures can have additional SPRs specific to
  270.                                                              those architectures!  The lookup routine is called only if
  271.                                                              the SPR is NOT one of the following predefined numbers:
  272.                                                                     
  273.                                                                 0 MQ      272 SPRG0   528 IBAT0U   536 DBAT0U   1008 HID0
  274.                                                                 1 XER     273 SPRG1   529 IBAT0L   537 DBAT0L   1009 HID1
  275.                                                                 4 RTCU    274 SPRG2   530 IBAT1U   538 DBAT1U   1010 IABR
  276.                                                                 5 RTCL    275 SPRG3   531 IBAT1L   539 DBAT1L   1013 DABR
  277.                                                                 6 DEC     280 ASR     532 IBAT2U   540 DBAT2U   1023 PIR
  278.                                                                 8 LR      282 EAR     533 IBAT2L   541 DBAT2L
  279.                                                                 9 CTR     284 TB      534 IBAT3U   542 DBAT3U
  280.                                                              18 DSIAR   285 TBU     535 IBAT3L   543 DBAT3L
  281.                                                              19 DAR     287 PVR
  282.                                                              22 DEC
  283.                                                              25 SDR1
  284.                                                              26 SRR0
  285.                                                              27 SRR1
  286.                                                             
  287.                                                              Not all of these SPRs are valid for all targets.  The
  288.                                                              disassembler will check to see if these SPRs are valid for
  289.                                                              the specified target architecture.  If they are not, the SPR
  290.                                                              number is treated as an invalid field and processed
  291.                                                              according to the Disassemble_FieldErr option, i.e., it’s
  292.                                                              accepted but returns a status warning, or the instruction is
  293.                                                              treated as invalid (“DC.L 0xXXXXXXXX”).
  294.  
  295.                                                              SPR numbers which are not on the list, and also do not have
  296.                                                              a lookup substitution name, are always accepted.  But since
  297.                                                              there is no way for the disassembler to validate these
  298.                                                              against the target, the Disassembler_InvSprMaybe return
  299.                                                              status flag will be set.                                                                    */
  300.                                                              
  301.  
  302. /* Finally, at long last, here's the definition of the disassembler...                                    */
  303.  
  304. typedef unsigned short DisassemblerStatus;        /* disassembler return status (see below)    */
  305.  
  306. DisassemblerStatus disassembler(unsigned long              *instruction, 
  307.                                                                 long                                dstAdjust,
  308.                                                                 DisassemblerOptions options,
  309.                                                                 char                                *mnemonic,
  310.                                                                 char                                *operand,
  311.                                                                 char                                *comment,
  312.                                                                 void                                *refCon,
  313.                                                                 DisassemblerLookups    lookupRoutine);
  314.     /*
  315.     Takes the four bytes pointed to by instruction and disassembles it, placing the mnemonic,
  316.     operand, and comment in the strings provided.  The caller is then free to format or use
  317.     the output strings any way appropriate to the application.  Any of these strings may be a
  318.     null pointer, in which case that portion of the disassembled instruction is not returned.
  319.     If they are not null, it is ASSUMED that the associated buffers are large enough to hold
  320.     the disassembled output.
  321.     
  322.     Comments are formatted starting with a "; " (or "#" if the appropriate "IBM" option is
  323.     set).  Invalid instructions generate a "dc.l" (".long" for IBM), an operand of the form
  324.     0xXXXXXXXX showing the actual instruction, and a comment with a message indicating what
  325.     is wrong with the instruction.
  326.     
  327.     For PC-relative branches, the comment generated is the destination address, the only
  328.     address that the disassembler "knows" about is the address of the code pointed to by the
  329.     instruction.  Generally, that may be a buffer that has no relation to "reality", i.e.,
  330.     the actual code loaded into the buffer.  Therefore, to allow the address comment to be
  331.     mapped back to some actual address, the caller may specify an adjustment factor,
  332.     specified by dstAdjust that is ADDED to the value that normally would be placed in the
  333.     comment.
  334.  
  335.     Many operands usually consist of registers, absolute and relocatable addresses, and
  336.     signed and unsigned values.  In places where these occur, the disassembler can call a
  337.     user specified routine to do the substitution using the lookupRoutine parameter if it
  338.     is not NULL.  A "refcon" is passed to the disassembler that is, in turn, passed on to
  339.     the lookup routine to allow a communication path between the disassembler caller and its
  340.     lookup routine.  The refcon can be anything.  The disassembler does not look at it.
  341.     
  342.     The caller also can control some aspects of the formatting with the DisassemblerOptions
  343.     as described above.  The options also specify the target architecture; Power, PowerPC32,
  344.     PowerPC64, or PowerPC601.
  345.     
  346.     The disassembler returns as its function result the DisassemblerStatus.  This may be
  347.     tested for 0 ("false" or DisInvalid defined below) to find out if an invalid instruction
  348.     was detected.  For valid instructions, the DisassemblerStatus is non zero and indicates
  349.     various attributes about the instruction as follows:                                                                    */
  350.     
  351.     /* Return status flags:                                                                                                                                */
  352.     
  353.     #define Disassembler_OK                     0x0001U    /* instruction successfully decoded                    */
  354.     #define Disassembler_InvRsvBits     0x0002U    /* invalidly coded reserved bits                        */
  355.     #define Disassembler_InvField         0x0004U    /* invalidly coded field(s)                                    */
  356.     #define Disassembler_InvSprMaybe    0x0008U    /* possibly invalid SPR                                            */
  357.     #define Disassembler_601Power          0x0010U    /* power instruction used with 601                    */
  358.     #define Disassembler_Privileged   0x0020U    /* privileged instruction                                        */
  359.     #define Disassembler_Optional         0x0040U    /* optional instruction                                            */
  360.     #define Disassembler_Branch                0x0080U    /* branch instruction                                                */
  361.     #define Disassembler_HasExtended  0x4000U    /* possible extended mnemonic                                */
  362.     #define Disassembler_ExtendedUsed 0x8000U    /* the extended mnemonic was generated            */
  363.  
  364.     #define DisInvalid ((DisassemblerStatus)0x0000U)    /*       invalid instruction                */
  365.  
  366.     /*
  367.     Unless DisInvalid (0) is returned as the function result, Disassembler_OK will always be
  368.     set.  The other flags have the following meaning:
  369.     
  370.     Disassembler_InvRsvBits        - The instruction had some or all of its reserved bits
  371.                                                             incorrectly coded, and the Disassemble_RsvBitsErr option was
  372.                                                             NOT set.  This is something like a "warning". With the option
  373.                                                             set, this condition is considered as an "error" and the
  374.                                                             "invalid instruction" is generated ("dc.l 0xXXXXXXXX").
  375.     
  376.     Disassembler_InvField            -    The instruction had fields incorrectly coded for the
  377.                                                             target, but is is still valid for some target (e.g., not
  378.                                                             valid for the 601 but valid for the PowerPC64), and the
  379.                                                             Disassemble_FieldErr option was NOT set.
  380.     
  381.     Disassembler_InvSprMaybe    - A mfspr or mtspr instruction references a POSSIBLY invalid
  382.                                                             SPR.  This occurs when an SPR value is not for one of the
  383.                                                             predefined SPR names (see list above) and there is no lookup
  384.                                                             routine, or it does not supply a substitution name.  In that
  385.                                                             case the SPR register number is generated.  Since there is
  386.                                                             no way of the disassembler knowing whether the register is
  387.                                                             valid for the architecture of interest, this flag is set 
  388.                                                             instead of Disassembler_InvField to indicate the possibility
  389.                                                             that the SPR may be invalid.
  390.     
  391.     Disassembler_601Power            - The options specified that the target architecture is the
  392.                                                             601 (Disassemble_PowerPC601), and a Power instruction was
  393.                                                             disassembled.  The 601 is basically an ORing of the Power
  394.                                                             and PowerPC32 architectures.  But this flag could be useful
  395.                                                             for "weeding" Power instructions out in preparation for use
  396.                                                             on a "pure" PowerPC32 or PowerPC64 architecture.
  397.     
  398.     Disassembler_Privileged        - The instruction is privileged.
  399.                                                             
  400.     Disassembler_Optional            - The instruction is optional.
  401.     
  402.     Disassembler_Branch                -    Branch instruction; bc[l][a], b[l][a], bclr[l], bcctr[l] and
  403.                                                             Power bcr[l], bcc[l].  If any of these instructions are
  404.                                                             processed the flag is set.  Branches are signaled because
  405.                                                             the caller might want to do some additional processing on
  406.                                                             these.  For example, a debugger might want to dynamically
  407.                                                             show which way the branch is taken, or static analysis might
  408.                                                             want to know possible exit points from a function or show
  409.                                                             the branch in some graphical way.  Although the caller could
  410.                                                             determine if the instruction is a branch, the disassembler
  411.                                                             always has to classify the instructions passed to it, so
  412.                                                             there is no sense having both do it if the information is
  413.                                                             already available.  Note, the caller might still, however,
  414.                                                             need to extract the BO and BI fields to determine the
  415.                                                             condition of the branch, but at least it only needs to be
  416.                                                             done when the flag is set.
  417.     
  418.     Disassembler_HasExtended     - The instruction POSSIBLY has an extended mnemonic, whether
  419.                                                             used or not used (as a function of the Disassemble_Extended
  420.                                                             option). Note, "possibly has an extended mnemonic"; the
  421.                                                             instruction could have extendeds, but not for all
  422.                                                             values of its operands.
  423.                                                             
  424.     Disassembler_ExtendedUsed - The instruction has an extended mnemonic, and it was used
  425.                                                             because the option (Disassemble_Extended) permits it.  The
  426.                                                             operand is formatted appropriate to the extended mnemonic.
  427.                                                             Whether the original basic form is placed in the comment or
  428.                                                             not is controlled by the Disassemble_BasicComm option.
  429.     */
  430.     
  431.     
  432. /* NOTES: 1. The disassembler library uses the convention that all externally visible     */
  433. /*                     names (linker symbols and macro names) begin with the letters "dis" (in any*/
  434. /*                     case).  The user should keep this in mind to avoid possible name conflicts.*/
  435.  
  436. /*                2. Except for statically declared (read only) tables, the disassembler uses no*/
  437. /*                     other global data.                                                                                                                    */
  438.  
  439. /*                3. The disassembler is fully self contained in that it has no explicit                 */
  440. /*                     references to any runtime library routines (e.g., strcpy).  There may,         */
  441. /*                     however, be implicit references generated by the (C) compiler.                            */
  442.  
  443. /*                4. The disassembler is written in standard ANSI C making it possible to easily*/
  444. /*                     move to other platforms.                                                                                                        */
  445.  
  446.  
  447. #ifdef __cplusplus
  448. }
  449. #endif
  450.  
  451. #endif
  452.